<.button_dropdown text="Actions" class="justify-center w-full sm:w-50">
  <:option>
    <span x-data="{ copied: false }" x-on:click={~s"
        copyWithCallbacks(
          String.raw`#{Jason.Formatter.pretty_print(Phoenix.json_library().encode!(@media_item))}`,
          () => copied = true, 
          () => copied = false
        )
      "}>
      Copy JSON
      <span x-show="copied" x-transition.duration.150ms><.icon name="hero-check" class="ml-2 h-4 w-4" /></span>
    </span>
  </:option>
  <:option>
    <div class="h-px w-full bg-bodydark2"></div>
  </:option>
  <:option>
    <.link
      href={~p"/sources/#{@media_item.source_id}/media/#{@media_item}/force_download"}
      method="post"
      data-confirm="Are you sure you force a download of this media?"
    >
      Force Download
    </.link>
  </:option>
  <:option>
    <div class="h-px w-full bg-bodydark2"></div>
  </:option>
  <:option>
    <.link
      href={~p"/sources/#{@media_item.source_id}/media/#{@media_item}"}
      method="delete"
      data-confirm="Are you sure you want to delete all files for this media item? This cannot be undone."
    >
      Delete Files
    </.link>
  </:option>
  <:option>
    <.link
      href={~p"/sources/#{@media_item.source_id}/media/#{@media_item}?prevent_download=true"}
      method="delete"
      data-confirm="Are you sure you want to delete all files for this media item and prevent it from re-downloading in the future? This cannot be undone."
    >
      Delete and Ignore
    </.link>
  </:option>
</.button_dropdown>
